import base64
import io

import numpy as np
from PIL import Image


def image2numpy(src):
    img_base64 = base64.b64decode(src.split(',')[1])
    image = Image.open(io.BytesIO(img_base64))
    im = image.convert('RGB')
    color_arr = np.array(im)

    return color_arr